home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2005 Utilities / CHIP Utilities 2005.7z / CHIP Utilities 2005.iso / docs / freedos / www.fcpa.com / includes / rollover_subpages.js < prev    next >
Encoding:
JavaScript  |  2003-05-13  |  3.6 KB  |  90 lines

  1. // Ultimate client-side JavaScript client sniff. Version 3.01
  2. // (C) Netscape Communications 1999-2001.  Permission granted to reuse and distribute.
  3.  
  4. // convert all characters to lowercase to simplify testing
  5. var agt=navigator.userAgent.toLowerCase();
  6.  
  7. // *** BROWSER VERSION ***
  8. // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
  9. var is_major = parseInt(navigator.appVersion);
  10. var is_minor = parseFloat(navigator.appVersion);
  11.  
  12. // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
  13. // If you want to allow spoofing, take out the tests for opera and webtv.
  14. var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
  15.             && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
  16.             && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
  17. var is_nav2 = (is_nav && (is_major == 2));
  18. var is_nav3 = (is_nav && (is_major == 3));
  19. var is_nav4 = (is_nav && (is_major == 4));
  20. var is_nav4up = (is_nav && (is_major >= 4));
  21. var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
  22.                       (agt.indexOf("; nav") != -1)) );
  23. var is_nav6 = (is_nav && (is_major == 5));
  24. var is_nav6up = (is_nav && (is_major >= 5));
  25. var is_gecko = (agt.indexOf('gecko') != -1);
  26.  
  27. var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
  28. var is_ie3    = (is_ie && (is_major < 4));
  29. var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5")==-1) );
  30. var is_ie4up  = (is_ie && (is_major >= 4));
  31. var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
  32. var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
  33. var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
  34. var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
  35. var is_mac    = (agt.indexOf("mac")!=-1);
  36.  
  37. /*
  38.       Copyright (c) 2001 Moonstone Interactive, Inc.
  39.       All Rights Reserved. No portion of this file, including but
  40.       not limited to any associated code, documents or images, may be
  41.       copied, retransmitted, reposted, duplicated or otherwise
  42.       used without the express written permission of Moonstone Interactive, Inc.
  43.  
  44. */        
  45.  
  46.   rollover = document.images;
  47.   function LoadGIF(image) {
  48.                 if (rollover) {
  49.                     eval (image + '= new Image()');     // Let browser do GC
  50.                     eval (image + '.src  = "/img/' + image + '.gif"');
  51.                 }
  52.     }
  53.          // takes to arguments html element name and giff name
  54.   function SwapImage(name, image) { 
  55.                   if (rollover) {
  56.                                    document[name].src = eval(image + '.src');
  57.                   }
  58.           }
  59.         
  60.     LoadGIF('global_nav_home_on');
  61.     LoadGIF('global_nav_home');
  62.     LoadGIF('global_nav_products_on');
  63.     LoadGIF('global_nav_products');
  64.     LoadGIF('global_nav_warranties_on');
  65.     LoadGIF('global_nav_warranties');
  66.     LoadGIF('global_nav_partners_on');
  67.     LoadGIF('global_nav_partners');
  68.     LoadGIF('global_nav_news_on');
  69.     LoadGIF('global_nav_news');
  70.     LoadGIF('global_nav_about_on');
  71.     LoadGIF('global_nav_about');
  72.     LoadGIF('global_footer_contact_on');
  73.     LoadGIF('global_footer_contact_static');
  74.     LoadGIF('global_footer_termspriv_on');
  75.     LoadGIF('global_footer_termspriv_static');
  76.     
  77.     
  78.     //This is for opening child windows
  79.     /*Example Tag:
  80.     <a onclick="openChildWin('http://www.sitename.com');return false;" href="#">www.sitename.com</a>
  81.      */
  82.     var childWin;
  83.     function closeChildWin() {
  84.         if(childWin != null && !childWin.closed) childWin.close();
  85.     }
  86.     
  87.     function openChildWin(aUrl){
  88.         closeChildWin();
  89.         childWin = open(aUrl, "childwindow", "resizable=1,location=1,status=1,menubar=1,toolbar=1,scrollbars=1,width=790,height=500,left=0,top=0,screenX=0,screenY=0");
  90.     }